{% extends 'base.html' %}
{% load zui %}
{% load my_template %}
{% block title %}城市列表{% endblock %}
{% block left %}{% include 'menu.html' %}{% endblock %}
{% block nav_bar %}
    <li>功能管理</li>
    <li>城市列表</li>
{% endblock %}
{% block workarea %}
    <form method="get" class="form form-inline">
        城市名称：{% zui_field form.city_name layout='inline' %}
        <button class="btn btn-default "><i class="icon-search"></i> 搜索</button>
        <a class="btn btn-default pull-right" href="{% url 'area_create' %}">添加城市</a>
    </form>
    <br/>
    <table class="table datatable">
        <thead>
        <tr>
            <th>序号</th>
            <th>城市名称</th>
            <th>城市代码</th>
            <th>州名称</th>
            <th>州代码</th>
            <th>地区名称</th>
            <th>级别</th>
            <th>操作</th>
        </tr>
        </thead>
        {% for item in object_list %}
            <tbody>
            <tr>
                <td>{{ item.id }}</td>
                <td>{{ item.parent.city_name }}</td>
                <td>{{ item.parent.city_code }}</td>
                <td>{{ item.parent.parent.state_name }}</td>
                <td>{{ item.parent.parent.state_code }}</td>
                <td>{{ item.area_name }}</td>
                <td>{{ item.category }}</td>
                <td>
                    <a href="{% url 'area_delete' item.id %}" title="删除"><i class="icon icon-trash"></i></a>
                </td>
            </tr>
            </tbody>
        {% endfor %}
    </table>
    {% if page_obj.has_other_pages %}
        {% zui_pagination page_obj %}
    {% endif %}

{% endblock %}

